cmake_minimum_required(VERSION 3.17)
project(mjson)

set(CMAKE_CXX_STANDARD 14)

file(GLOB SOURCES_AND_HEADERS "*.cpp" "include/*.h")

add_executable(mjson main.cpp ${SOURCES_AND_HEADERS})
target_include_directories(${PROJECT_NAME}
        PUBLIC ${PROJECT_SOURCE_DIR}/include
        )
include(FetchContent)

FetchContent_Declare(json
        GIT_REPOSITORY https://gitee.com/slamist/json.git
        GIT_TAG v3.7.3)
FetchContent_MakeAvailable(json)

target_link_libraries(mjson PRIVATE nlohmann_json::nlohmann_json)

FetchContent_Declare(spdlog
        GIT_REPOSITORY https://gitee.com/mai12/spdlog.git
        GIT_TAG v1.4.1)
FetchContent_MakeAvailable(spdlog)
target_link_libraries(mjson PRIVATE spdlog::spdlog)